Skip to content

Commit

Permalink
fix: use js file extensions when javascript option is selected for in…
Browse files Browse the repository at this point in the history
…it (#25)

* fix: js file extensions

* chore: add changeset
  • Loading branch information
innerdvations authored Jul 23, 2024
1 parent 6c829cc commit 6f9c20b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-shirts-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@strapi/sdk-plugin': patch
---

Use correct extensions for javascript projects
26 changes: 13 additions & 13 deletions src/cli/commands/plugin/init/files/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const TYPESCRIPT = (pluginName: string): TemplateFile[] => [

const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
{
name: 'server/src/index.ts',
name: 'server/src/index.js',
contents: outdent`
'use strict';
Expand Down Expand Up @@ -190,7 +190,7 @@ const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
`,
},
{
name: 'server/src/bootstrap.ts',
name: 'server/src/bootstrap.js',
contents: outdent`
'use strict';
Expand All @@ -202,7 +202,7 @@ const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
`,
},
{
name: 'server/src/destroy.ts',
name: 'server/src/destroy.js',
contents: outdent`
'use strict';
Expand All @@ -214,7 +214,7 @@ const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
`,
},
{
name: 'server/src/register.ts',
name: 'server/src/register.js',
contents: outdent`
'use strict';
Expand All @@ -226,7 +226,7 @@ const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
`,
},
{
name: 'server/src/config/index.ts',
name: 'server/src/config/index.js',
contents: outdent`
'use strict';
Expand All @@ -237,15 +237,15 @@ const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
`,
},
{
name: 'server/src/content-types/index.ts',
name: 'server/src/content-types/index.js',
contents: outdent`
'use strict';
module.exports = {};
`,
},
{
name: 'server/src/controllers/index.ts',
name: 'server/src/controllers/index.js',
contents: outdent`
'use strict';
Expand All @@ -257,7 +257,7 @@ const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
`,
},
{
name: 'server/src/controllers/controller.ts',
name: 'server/src/controllers/controller.js',
contents: outdent`
'use strict';
Expand All @@ -275,23 +275,23 @@ const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
`,
},
{
name: 'server/src/middlewares/index.ts',
name: 'server/src/middlewares/index.js',
contents: outdent`
'use strict';
module.exports = {};
`,
},
{
name: 'server/src/policies/index.ts',
name: 'server/src/policies/index.js',
contents: outdent`
'use strict';
module.exports = {};
`,
},
{
name: 'server/src/routes/index.ts',
name: 'server/src/routes/index.js',
contents: outdent`
'use strict';
Expand All @@ -309,7 +309,7 @@ const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
`,
},
{
name: 'server/src/services/index.ts',
name: 'server/src/services/index.js',
contents: outdent`
'use strict';
Expand All @@ -321,7 +321,7 @@ const JAVASCRIPT = (pluginName: string): TemplateFile[] => [
`,
},
{
name: 'server/src/services/service.ts',
name: 'server/src/services/service.js',
contents: outdent`
'use strict';
Expand Down

0 comments on commit 6f9c20b

Please sign in to comment.