Skip to content

Commit

Permalink
chore: gives the last commonjs modules the .cjs extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sverweij committed Sep 3, 2024
1 parent 38b45d3 commit b05870f
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"docs/**/*",
"public/**/*",
"src/**/*-parser.mjs",
"src/**/*.template.js",
"src/**/*.template.cjs",
"src/cli/main.mts"
],
"reporter": ["text-summary", "lcov", "html", "json-summary"]
Expand Down
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ exclude_patterns:
- "**/*.d.ts"
- "**/*.d.mts"
- "src/**/*parser.mjs"
- "src/render/**/*.template.js"
- "src/render/**/*.template.cjs"
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"node_modules",
"public",
"src/**/*-parser.mjs",
"src/**/*.template.js",
"src/**/*.template.cjs",
],
overrides: [
{
Expand Down
2 changes: 1 addition & 1 deletion .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ paths:
- docs/index.html
- docs/inpage.html
paths-ignore:
- "**/*.template.js"
- "**/*.template.cjs"
- "**/*-parser.mjs"
queries:
- uses: security-and-quality
Expand Down
16 changes: 6 additions & 10 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
src/cli/attributes-parser.mjs
src/parse/smcat/smcat-parser.mjs
src/render/dot/dot.states.template.js
src/render/dot/dot.template.js
src/render/scxml/scxml.states.template.js
src/render/scxml/scxml.template.js
src/render/smcat/smcat.template.js
dist/render/dot/dot.states.template.js
dist/render/dot/dot.template.js
dist/render/scxml/scxml.states.template.js
dist/render/scxml/scxml.template.js
dist/render/smcat/smcat.template.js
src/render/dot/dot.states.template.cjs
src/render/dot/dot.template.cjs
src/render/smcat/smcat.template.cjs
dist/render/dot/dot.states.template.cjs
dist/render/dot/dot.template.cjs
dist/render/smcat/smcat.template.cjs
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.SUFFIXES: .js .peggy .css .html .smcat .svg .png .jpg
.SUFFIXES: .cjs .peggy .css .html .smcat .svg .png .jpg
PEGGY=node_modules/peggy/bin/peggy.js
ESBUILD=node_modules/.bin/esbuild
HANDLEBARS=node_modules/.bin/handlebars
GRAMMKIT=node_modules/.bin/grammkit

GENERATED_BASE_SOURCES=src/parse/smcat/smcat-parser.mjs \
src/parse/smcat-ast.schema.mts \
src/render/dot/dot.states.template.js \
src/render/dot/dot.template.js \
src/render/smcat/smcat.template.js \
src/render/dot/dot.states.template.cjs \
src/render/dot/dot.template.cjs \
src/render/smcat/smcat.template.cjs \
src/version.mts

EXTRA_GENERATED_CLI_SOURCES=src/cli/attributes-parser.mjs
Expand All @@ -33,7 +33,7 @@ GENERATED_SOURCES=$(GENERATED_BASE_SOURCES) $(EXTRA_GENERATED_CLI_SOURCES) $(EXT
%attributes-parser.mjs: %peg/attributes-parser.peggy
$(PEGGY) --extra-options-file config/peggy-config-attributes-parser.json -o $@ $<

src/render/%.template.js: src/render/%.template.hbs
src/render/%.template.cjs: src/render/%.template.hbs
$(HANDLEBARS) --min --commonjs handlebars/dist/handlebars.runtime -f $@ $<

src/version.mts: package.json
Expand Down Expand Up @@ -72,8 +72,8 @@ docs/grammar.html: src/parse/smcat/peg/smcat-parser.peggy
docs: $(GENERATED_SOURCES)

templates-dist:
cp src/render/dot/*.template.js dist/render/dot/.
cp src/render/smcat/*.template.js dist/render/smcat/.
cp src/render/dot/*.template.cjs dist/render/dot/.
cp src/render/smcat/*.template.cjs dist/render/smcat/.

dist:
mkdir -p $@
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions dist/render/dot/render-dot-from-ast.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/render/smcat/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
4 changes: 2 additions & 2 deletions docs/smcat-online-interpreter.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/state-machine-cat-inpage.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"#*": "./src/*"
},
"sideEffects": [
"dist/render/smcat/smcat.template.js",
"dist/render/dot/dot.states.template.js",
"dist/render/dot/dot.template.js"
"dist/render/smcat/smcat.template.cjs",
"dist/render/dot/dot.states.template.cjs",
"dist/render/dot/dot.template.cjs"
],
"scripts": {
"build": "make clean dist pages cli-build && rm -rf dist && tsc && make templates-dist && prettier --cache --log-level warn --write --use-tabs dist && chmod 700 dist/cli/main.mjs",
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/render/dot/render-dot-from-ast.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type {
IStateMachine,
} from "../../../types/state-machine-cat.mjs";

await import("./dot.template.js");
await import("./dot.states.template.js");
await import("./dot.template.cjs");
await import("./dot.states.template.cjs");

Handlebars.registerPartial(
"dot.states.template.hbs",
Expand Down
2 changes: 1 addition & 1 deletion src/render/smcat/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
ITransition,
} from "../../../types/state-machine-cat.mjs";

await import("./smcat.template.js");
await import("./smcat.template.cjs");

type IExtendedState = { hasExtendedAttributes?: boolean } & IState;
type IExtendedTransition = { hasExtendedAttributes?: boolean } & ITransition;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"src/**/*.mts",
"src/**/*.ts",
"src/**/*.mjs",
"src/**/*.js"
"src/**/*.cjs"
],
"exclude": ["test/**/*.spec.{mts,cts,ts,js,mjs,cjs}"],
"ts-node": {
Expand Down

0 comments on commit b05870f

Please sign in to comment.